home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / dbg.arc / BUGSPRAY.ASM next >
Encoding:
Assembly Source File  |  1988-05-30  |  3.3 KB  |  147 lines

  1. ;
  2. ; DEBUG    - The worlds most powerful debugger.
  3. ;
  4. cseg    segment
  5.     assume    cs:cseg,ds:cseg,es:cseg,ss:cseg
  6.     org    0100h
  7. ;
  8. normal    equ    07h
  9. cr    equ    0dh
  10. lf    equ    0ah
  11. dos    equ    21h
  12. ;
  13. ddt:    mov    ah,33h
  14.     mov    al,0
  15.     int    dos            ;get status of ctrl-c
  16.     mov    check,dl        ;and save it
  17.     mov    ah,33h
  18.     mov    al,1
  19.     mov    dl,0            ;turn ctrl-c off
  20.     int    dos
  21.     call    cls            ;clear screen
  22.  
  23.     les    bx,dword ptr vidmode    ;get address of    mode byte in es:bx
  24.     cmp    byte ptr es:[bx],7    ;color or mono?
  25.     mov    ax,0b000h        ;mono
  26.     jz    mono
  27.     mov    ax,0b800h        ;color
  28. mono:    mov    word ptr ds:[scrseg],ax    ;we'll save this at scrseg
  29.  
  30. ;
  31. ; output the can and instructions
  32.     mov    si,offset can
  33. canlp:    call    writef
  34.     cmp    byte ptr ds:[si],0ffh
  35.     jnz    canlp
  36. ;
  37. ; get a    key, display bits, loop.  ESC to exit
  38. loopit:    mov    dx,162ah
  39.     call    set_cursor
  40.     mov    ah,0
  41.     int    16h            ;get a character
  42.     cmp    ah,01
  43.     jnz    dobits
  44.     call    cls
  45.     mov    ah,33h
  46.     mov    al,01
  47.     mov    dl,check
  48.     int    dos            ;restore ctrl-c    status
  49.     mov    ax,4c00h
  50.     int    dos
  51. ;
  52. ; display the bits
  53. dobits:    mov    dx,0211h
  54.     mov    cx,offset bits
  55.     call    display_string        ;display bits
  56.     mov    dx,0211h
  57.     mov    cx,offset nobits    ;erase bits
  58.     call    display_string
  59.     jmp    short loopit
  60. ;
  61. display_string:
  62.     push    cx
  63.     call    set_cursor
  64.     pop    dx
  65.     mov    ah,9
  66.     int    21h
  67.     ret
  68. ;
  69. set_cursor:
  70.     xor    bh,bh
  71.     mov    ah,2
  72.     int    10h
  73.     ret
  74.  
  75. cls:    xor    cx,cx
  76.     mov    dx,184fh
  77.     mov    bh,normal
  78.     mov    ax,600h
  79.     int    10h
  80.     ret
  81.  
  82. ;
  83. ; write    string pointed to by DS:SI to the video    display
  84. ; string format    is:
  85. ; col,row,attr,'string',0
  86. ;
  87. writef:    push    es            ;save this guy
  88. ; offset  = (x<<1) + (y*160)
  89.     xor    ah,ah
  90.     lodsb                ;get column
  91.     add    al,al
  92.     mov    di,ax            ;x*2 in    di
  93.     lodsb                ;get row
  94.     xor    ah,ah
  95.     mov    dx,160
  96.     mul    dx
  97.     add    di,ax            ;position in di
  98.     lodsb                ;get attribute
  99.     mov    ah,al            ;to AH
  100.     mov    bx,word    ptr ds:[scrseg]    ;screen    segment
  101.     mov    es,bx            ;in ES
  102. write_loop:
  103.     lodsb                ;get character
  104.     or    al,al            ;if 0,
  105.     jz    write_done        ; we're done
  106.     stosw                ;otherwise, write char and attribute
  107.     jmp    short write_loop
  108. write_done:
  109.     pop    es
  110.     ret
  111. ;
  112. ;    Data area
  113. can:
  114.     db    0, 1,7,'      _________',0
  115.     db    0, 2,7,'      :       :<<',0
  116.     db    0, 3,7,'      :       :',0
  117.     db    0, 4,7,'    =============',0
  118.     db    0, 5,7,'   /             \',0
  119.     db    0, 6,7,' ===================',0
  120.     db    0, 7,7,'|                   |',0
  121.     db    0, 8,7,'|    H I D D E N    |',0
  122.     db    0, 9,7,'|      F L A G      |',0
  123.     db    0,10,7,'|                   |',0
  124.     db    0,11,7,'|  S O F T W A R E  |',0
  125.     db    0,12,7,'|      "B U G"      |',0
  126.     db    0,13,7,'|    K I L L E R    |',0
  127.     db    0,14,7,'|                   |',0
  128.     db    0,15,7,'|       WORKS       |',0
  129.     db    0,16,7,'|       ON ALL      |  DIRECTIONS: Hold program listing to the right',0
  130.     db    0,17,7,'|     LANGUAGES!    |              of the screen.  When ready, press',0
  131.     db    0,18,7,'|                   |              ANY KEY to release a powerful stream',0
  132.     db    0,19,7,'|     BITBRAIN      |              of bug killing bits.  Some bugs may',0
  133.     db    0,20,7,'|  CHEMICALS, INC.  |              require repeated applications.',0
  134.     db    0,21,7,'| NET WT. 2 Megabits|',0
  135.     db    0,22,7,'=====================              Action: ',0
  136.     db    0ffh
  137.  
  138. bits:    db    '101010101010101010101010101010101010101010101010101010101010$'
  139. nobits:    db    '                                                            ',7,'$'
  140. check    db    0            ;status    of ctrl-c checking
  141. scrseg    dw    0
  142. vidmode    dw    1097            ;address of video mode byte
  143.     dw    0
  144.  
  145. cseg    ends
  146.     end    ddt
  147.